home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2.sit
/
Raven 1.2
/
Source
/
Foundation
/
OS
/
ZGestalt.h
< prev
next >
Wrap
Text File
|
1997-08-16
|
3KB
|
105 lines
/*
* File: ZGestalt.h
* Summary: Provides information about the system.
* Written by: Jesse Jones
*
* Copyright ゥ 1996-1997 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <4> 8/16/97 JDJ Added hasContextMenus.
* <3> 8/03/97 JDJ Added hasAppearanceMgr.
* <2> 2/28/97 JDJ Added virtualMemIsOn.
* <1> 1/28/96 JDJ Created
*/
#pragma once
#include <Files.h>
#include <Processes.h>
#include <ZTypes.h>
//-----------------------------------
// Types
//
typedef ulong Version; // packed version number, eg 0x0753 means 7.5.3
// ===================================================================================
// class UGestalt
// ===================================================================================
class UGestalt {
public:
static Version systemVersion;
static bool hasSystem7;
static bool hasFPU;
static bool hasTempMem;
static bool hasTrueType;
static bool hasThreadMgr;
static bool hasASLM;
static bool hasCFM;
static Version soundMgrVersion;
static bool hasSoundMgr3;
static bool has16BitSound;
static Version quickDrawVersion; // 32-bit QuickDraw starts with 2.0.0
static bool hasColorQD;
static bool has32BitQD;
static bool hasGrayishText;
static bool hasAppearanceMgr;
static bool hasContextMenus;
static bool hasDisplayMgr;
static Version displayMgrVersion;
static bool hasQuickTime;
static Version quickTimeVersion;
static bool hasDragMgr;
static bool hasTranslucentDrag;
static bool hasQDGXGraphics;
static bool hasQDGXPrinting;
static bool hasQuickDraw3D;
static Version quickDraw3DVersion;
static Version textEditVersion;
static Version scriptMgrVersion;
static ulong logicalRAM; // includes virtual memory
static ulong physicalRAM; // the real McCoy
static bool virtualMemIsOn;
static FSSpec appSpec; // volume, dir, and name of app
static short appResRefNum; // applicationユs resource refNum
static ProcessSerialNumber psn;
static ulong sizeFlags; // SIZE resource flags (use mode constants in Processes.h to parse these)
static bool inited;
static void Init();
};
// ===================================================================================
// Helper Functions
// ===================================================================================
bool TrapAvailable(ushort theTrap);
// returns whether given trap is available
bool TestGestaltMask(ulong selector, long bitmap);
// ask Gestalt whether a feature is available
inline bool TestGestaltBit(ulong selector, long bitNum) {return TestGestaltMask(selector, 1 << bitNum);}
// like TestGestaltMask(), but takes a bit number instead of a bit mask
bool CheckCFMLink(void* fnPtr);
// return true if the CFM library function has been successfully linked